Adafruit Fingerprint Library: Adafruit_Fingerprint Class Reference

Adafruit Fingerprint Library

Public Member Functions | Public Attributes | List of all members
Adafruit_Fingerprint Class Reference

## Public Member Functions

| Adafruit_Fingerprint (SoftwareSerial *)
| Instantiates sensor with Software Serial. More...
| Adafruit_Fingerprint (HardwareSerial *)
| Instantiates sensor with Hardware Serial. More...
void | begin (uint16_t baud)
| Initializes serial interface and baud rate. More...
boolean | verifyPassword (void)
| Verifies the sensors' access password (default password is 0x0000000). A good way to also check if the sensors is active and responding. More...
uint8_t | getImage (void)
| Ask the sensor to take an image of the finger pressed on surface. More...
uint8_t | image2Tz (uint8_t slot=1)
| Ask the sensor to convert image to feature template. More...
uint8_t | createModel (void)
| Ask the sensor to take two print feature template and create a model. More...
uint8_t | emptyDatabase (void)
| Ask the sensor to delete ALL models in memory. More...
uint8_t | storeModel (uint16_t id)
| Ask the sensor to store the calculated model for later matching. More...
uint8_t | loadModel (uint16_t id)
| Ask the sensor to load a fingerprint model from flash into buffer 1. More...
uint8_t | getModel (void)
| Ask the sensor to transfer 256-byte fingerprint template from the buffer to the UART. More...
uint8_t | deleteModel (uint16_t id)
| Ask the sensor to delete a model in memory. More...
uint8_t | fingerFastSearch (void)
| Ask the sensor to search the current slot 1 fingerprint features to match saved templates. The matching location is stored in fingerID and the matching confidence in confidence More...
uint8_t | getTemplateCount (void)
| Ask the sensor for the number of templates stored in memory. The number is stored in templateCount on success. More...
void | writeStructuredPacket (const Adafruit_Fingerprint_Packet &p)
| Helper function to process a packet and send it over UART to the sensor packet A structure containing the bytes to transmit.
uint8_t | getStructuredPacket (Adafruit_Fingerprint_Packet *p, uint16_t timeout=DEFAULTTIMEOUT)
| Helper function to receive data over UART from the sensor and process it into a packet packet A structure containing the bytes received timeount how many milliseconds we're willing to wait.

## Public Attributes

uint16_t | fingerID
| The matching location that is set by fingerFastSearch()
uint16_t | confidence
| The confidence of the fingerFastSearch() match, higher numbers are more confidents.
uint16_t | templateCount
| The number of stored templates in the sensor, set by getTemplateCount()

## Constructor & Destructor Documentation

## ◆ Adafruit_Fingerprint() [1/2]

Adafruit_Fingerprint::Adafruit_Fingerprint | ( | SoftwareSerial * | ss | ) |

Instantiates sensor with Software Serial.

Parameters

  ss | Pointer to SoftwareSerial object

## ◆ Adafruit_Fingerprint() [2/2]

Adafruit_Fingerprint::Adafruit_Fingerprint | ( | HardwareSerial * | hs | ) |

Instantiates sensor with Hardware Serial.

Parameters

  hs | Pointer to HardwareSerial object

## Member Function Documentation

## ◆ begin()

void Adafruit_Fingerprint::begin | ( | uint16_t | baudrate | ) |

Initializes serial interface and baud rate.

Parameters

  baudrate | Sensor's UART baud rate (usually 57600, 9600 or 115200)

## ◆ createModel()

uint8_t Adafruit_Fingerprint::createModel | ( | void |  | ) |

Ask the sensor to take two print feature template and create a model.

Returns
  `FINGERPRINT_OK` on success
  `FINGERPRINT_PACKETRECIEVEERR` on communication error
  `FINGERPRINT_ENROLLMISMATCH` on mismatch of fingerprints

## ◆ deleteModel()

uint8_t Adafruit_Fingerprint::deleteModel | ( | uint16_t | location | ) |

Ask the sensor to delete a model in memory.

Parameters

  location | The model location #

Returns
  `FINGERPRINT_OK` on success
  `FINGERPRINT_BADLOCATION` if the location is invalid
  `FINGERPRINT_FLASHERR` if the model couldn't be written to flash memory
  `FINGERPRINT_PACKETRECIEVEERR` on communication error

## ◆ emptyDatabase()

uint8_t Adafruit_Fingerprint::emptyDatabase | ( | void |  | ) |

Ask the sensor to delete ALL models in memory.

Returns
  `FINGERPRINT_OK` on success
  `FINGERPRINT_BADLOCATION` if the location is invalid
  `FINGERPRINT_FLASHERR` if the model couldn't be written to flash memory
  `FINGERPRINT_PACKETRECIEVEERR` on communication error

## ◆ fingerFastSearch()

uint8_t Adafruit_Fingerprint::fingerFastSearch | ( | void |  | ) |

Ask the sensor to search the current slot 1 fingerprint features to match saved templates. The matching location is stored in fingerID and the matching confidence in confidence

Returns
  `FINGERPRINT_OK` on fingerprint match success
  `FINGERPRINT_NOTFOUND` no match made
  `FINGERPRINT_PACKETRECIEVEERR` on communication error

## ◆ getImage()

uint8_t Adafruit_Fingerprint::getImage | ( | void |  | ) |

Ask the sensor to take an image of the finger pressed on surface.

Returns
  `FINGERPRINT_OK` on success
  `FINGERPRINT_NOFINGER` if no finger detected
  `FINGERPRINT_PACKETRECIEVEERR` on communication error
  `FINGERPRINT_IMAGEFAIL` on imaging error

## ◆ getModel()

uint8_t Adafruit_Fingerprint::getModel | ( | void |  | ) |

Ask the sensor to transfer 256-byte fingerprint template from the buffer to the UART.

Returns
  `FINGERPRINT_OK` on success
  `FINGERPRINT_PACKETRECIEVEERR` on communication error

## ◆ getTemplateCount()

uint8_t Adafruit_Fingerprint::getTemplateCount | ( | void |  | ) |

Ask the sensor for the number of templates stored in memory. The number is stored in templateCount on success.

Returns
  `FINGERPRINT_OK` on success
  `FINGERPRINT_PACKETRECIEVEERR` on communication error

## ◆ image2Tz()

uint8_t Adafruit_Fingerprint::image2Tz | ( | uint8_t | slot = `1` | ) |

Ask the sensor to convert image to feature template.

Parameters

  slot | Location to place feature template (put one in 1 and another in 2 for verification to create model)

Returns
  `FINGERPRINT_OK` on success
  `FINGERPRINT_IMAGEMESS` if image is too messy
  `FINGERPRINT_PACKETRECIEVEERR` on communication error
  `FINGERPRINT_FEATUREFAIL` on failure to identify fingerprint features
  `FINGERPRINT_INVALIDIMAGE` on failure to identify fingerprint features

## ◆ loadModel()

uint8_t Adafruit_Fingerprint::loadModel | ( | uint16_t | location | ) |

Ask the sensor to load a fingerprint model from flash into buffer 1.

Parameters

  location | The model location #

Returns
  `FINGERPRINT_OK` on success
  `FINGERPRINT_BADLOCATION` if the location is invalid
  `FINGERPRINT_PACKETRECIEVEERR` on communication error

## ◆ storeModel()

uint8_t Adafruit_Fingerprint::storeModel | ( | uint16_t | location | ) |

Ask the sensor to store the calculated model for later matching.

Parameters

  location | The model location #

Returns
  `FINGERPRINT_OK` on success
  `FINGERPRINT_BADLOCATION` if the location is invalid
  `FINGERPRINT_FLASHERR` if the model couldn't be written to flash memory
  `FINGERPRINT_PACKETRECIEVEERR` on communication error

## ◆ verifyPassword()

boolean Adafruit_Fingerprint::verifyPassword | ( | void |  | ) |

Verifies the sensors' access password (default password is 0x0000000). A good way to also check if the sensors is active and responding.

Returns
  True if password is correct

The documentation for this class was generated from the following files:

- Adafruit_Fingerprint.h
- Adafruit_Fingerprint.cpp